package inutan.game;

import inutan.game.condition.ConditionManager;
import org.ricks.boot.AbstractBootstrap;
import org.ricks.boot.Scan;
import org.ricks.common.event.EventBus;
import org.ricks.common.event.IEvent;
import org.ricks.net.NetContext;
import org.ricks.orm.OrmContext;

@Scan("intutan.game")
public class GameBootstrap extends AbstractBootstrap {

    @Override
    protected void onStart() {
//        IocContext.me().init();
        EventBus.me().init(); //初始化事件机制
        EventBus.me().listener((IEvent event) ->  ConditionManager.condition(event)); //事件触发监听
//        OrmContext.me().init(); //初始化ORM
        NetContext.me().init();
    }

    @Override
    protected void onStop() {
        EventBus.me().shutdown();
        OrmContext.me().shutdown();
    }
}
